<#assign ctx=springMacroRequestContext.contextPath />
<#include "/macro/publicMacro.ftl">
<#import "/macro/pagination.ftl" as Pagination>

<@header title="用户列表">
    <link href="${ctx}/resource/common/css/pagination.css" rel="stylesheet">
    <link href="${ctx}/resource/frame/datetimepicker/jquery.datetimepicker.min.css" rel="stylesheet">
</@header>

<@body>
    <h2 class="module-title">用户管理</h2>

    <div class="alert alert-primary" role="alert">
        <form class="form-inline form-margin" action="${ctx}/imUser/list">
            <div class="form-group mb-2">
                <label for="code" >登录码:</label>
                <input type="text" class="form-control" id="code" name="code" value="${imUser.code}">
            </div>
            <div class="form-group mb-2">
                <label for="tenantId" >租户id:</label>
                <input type="text" class="form-control" id="tenantId" name="tenantId" value="${imUser.tenantId}">
            </div>
            <#--<div class="form-group mb-2">-->
                <#--<label for="departmentId" >部门id:</label>-->
                <#--<input type="text" class="form-control" id="departmentId" name="departmentId" value="${imUser.departmentId}">-->
            <#--</div>-->
            <div class="form-group mb-2">
                <label for="mobile" >手机号:</label>
                <input type="text" class="form-control" id="mobile" name="mobile" value="${imUser.mobile}">
            </div>
            <#--<div class="form-group mb-2">-->
                <#--<label for="sex" >性别:</label>-->
                <#--<input type="text" class="form-control" id="sex" name="sex" value="${imUser.sex}">-->
            <#--</div>-->
            <#--<div class="form-group mb-2">-->
                <#--<label for="enable" >是否可用:</label>-->
                <#--<input type="text" class="form-control" id="enable" name="enable" value="${imUser.enable}">-->
            <#--</div>-->
            <div class="form-group mx-sm-3 mb-2">
                <label for="startLoginTime">开始上次登录时间:</label>
                <input type="text" class="form-control" name="startLoginTime" id="startLoginTime" aria-describedby="上次登录时间" placeholder="上次登录时间" value="${(imUser.startLoginTime?string('yyyy-MM-dd hh:mm:ss'))!}">
                <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
            </div>
            <div class="form-group mx-sm-3 mb-2">
                <label for="endLoginTime">结束上次登录时间:</label>
                <input type="text" class="form-control" name="endLoginTime" id="endLoginTime" aria-describedby="上次登录时间" placeholder="上次登录时间" value="${(imUser.endLoginTime?string('yyyy-MM-dd hh:mm:ss'))!}">
                <span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>
            </div>
                <!--  do nothing -->
            <#--<div class="form-group mx-sm-3 mb-2">-->
                <#--<label for="startUpdateTime">开始更新时间:</label>-->
                <#--<input type="text" class="form-control" name="startUpdateTime" id="startUpdateTime" aria-describedby="更新时间" placeholder="更新时间" value="${(imUser.startUpdateTime?string('yyyy-MM-dd hh:mm:ss'))!}">-->
                <#--<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>-->
            <#--</div>-->
            <#--<div class="form-group mx-sm-3 mb-2">-->
                <#--<label for="endUpdateTime">结束更新时间:</label>-->
                <#--<input type="text" class="form-control" name="endUpdateTime" id="endUpdateTime" aria-describedby="更新时间" placeholder="更新时间" value="${(imUser.endUpdateTime?string('yyyy-MM-dd hh:mm:ss'))!}">-->
                <#--<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span></span>-->
            <#--</div>-->

            <div class="form-group mx-sm-3 mb-2">
                <button type="submit" class="btn btn-primary">查询</button>
            </div>

            
            <div class="form-group mx-sm-3 mb-2" style="float:right">
                <span style="float:left"><a href="${ctx}/imUser/toAdd">添加数据</a></span>
            </div>
            
        </form>
    </div>

    <div class="table-responsive">
        <table class="table table-striped table-bordered">
            <thead>
                <th>主键</th>
                <th>登录码</th>
                <#--<th>登录密码</th>-->
                <th>租户id</th>
                <th>部门id</th>
                <th>手机号</th>
                <th>头像</th>
                <th>座右铭</th>
                <th>性别</th>
                <th>是否可用</th>
                <th>上次登录时间</th>
                <th>创建时间</th>
                <th>更新时间</th>
                <th>操作</th>
            </thead>
            <tbody>
            <#list imUsers.beans as imUser>
                <tr>
                    <th>${imUser.id!}</th>
                    <th>${imUser.code!}</th>
                    <#--<th>${imUser.password!}</th>-->
                    <th>${imUser.tenantId!}</th>
                    <th>${imUser.departmentId!}</th>
                    <th>${imUser.mobile!}</th>
                    <th>${imUser.headImg!}</th>
                    <th>${imUser.motto!}</th>
                    <th>${imUser.sex!}</th>
                    <th>${imUser.enable!}</th>
                    <th>${(imUser.loginTime?string('yyyy-MM-dd hh:mm:ss'))!} </th>
                    <th>${(imUser.createTime?string('yyyy-MM-dd hh:mm:ss'))!} </th>
                    <th>${(imUser.updateTime?string('yyyy-MM-dd hh:mm:ss'))!} </th>
                    <th><a class="btn btn-primary btn-sm" href="${ctx}/imUser/view/${imUser.id?c}/${imUser.tenantId?c}" role="button" aria-pressed="true">详情</a>
                        <a class="btn btn-info btn-sm" href="${ctx}/imUser/toEdit/${imUser.id?c}/${imUser.tenantId?c}" role="button" aria-pressed="true">编辑</a>
                    </th>
                </tr>
            </#list>
            </tbody>
        </table>

        <@Pagination.pagination formId="imUserForm"
            pageNo=imUsers.pageNo
            pageTotal=imUsers.pageTotal
            total=imUsers.total
            pageSize=imUsers.pageSize
            action="${ctx}/imUser/list">
        </@Pagination.pagination>
    </div>
</@body>

<@footer>
    <script src="${ctx}/resource/frame/datetimepicker/jquery.datetimepicker.full.min.js"></script>

    <script type="text/javascript">
        $(function () {
                $('#startLoginTime').datetimepicker({
                    format:'Y-m-d H:i:s',
                    lang:'zh'});
                $('#endLoginTime').datetimepicker({
                    format:'Y-m-d H:i:s',
                    lang:'zh'});
                $('#startCreateTime').datetimepicker({
                    format:'Y-m-d H:i:s',
                    lang:'zh'});
                $('#endCreateTime').datetimepicker({
                    format:'Y-m-d H:i:s',
                    lang:'zh'});
                $('#startUpdateTime').datetimepicker({
                    format:'Y-m-d H:i:s',
                    lang:'zh'});
                $('#endUpdateTime').datetimepicker({
                    format:'Y-m-d H:i:s',
                    lang:'zh'});
        });
    </script>

    <script src="${ctx}/resource/common/js/pagination.js"></script>
    <script src="${ctx}/resource/common/js/jquery.validate.min.js"></script>
</@footer>